<?php

/**
 * CodeDepartment form base class.
 *
 * @method CodeDepartment getObject() Returns the current form's model object
 *
 * @package    Amawal Invest
 * @subpackage form
 * @author     Ameen Shoman<amin.shoman@gmail.com>
 */
abstract class BaseCodeDepartmentForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'        => new sfWidgetFormInputHidden(),
      'branch_id' => new sfWidgetFormPropelChoice(array('model' => 'Branch', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'id'        => new sfValidatorPropelChoice(array('model' => 'CodeDepartment', 'column' => 'id', 'required' => false)),
      'branch_id' => new sfValidatorPropelChoice(array('model' => 'Branch', 'column' => 'id', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('code_department[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'CodeDepartment';
  }

  public function getI18nModelName()
  {
    return 'CodeDepartmentI18n';
  }

  public function getI18nFormClass()
  {
    return 'CodeDepartmentI18nForm';
  }

}
